<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="/fuman/js/oversea.js"></script>
<title>物料信息</title>
<script type="text/javascript">
	function addstock()
	{
		$('#changstatusform').modal('show');
	}
	function changstock()
	{
		$('#changstockform').modal('show');
	}

	function stockout()
	{
		var vote_arr = document.getElementsByName("ppid[]");
		var idarr = new Array();
		var i=0;
		var str="";
		for(var j = 0; j < vote_arr.length; j++)
		{
			if(vote_arr[j].checked == true)
			{
				idarr[i] = vote_arr[j].value;
				str += vote_arr[j].value+",";
				i++;
			}

		}
		if(i<=0){
			alert("未选中数据");
		}else{
			$.post("/oversea/ajaxbutton", {"op": "stockout","str":str},
					function(data){

						if(data)
						{
							var tmp = "";
							for(var i=0;i<data.length;i++)
							{
								tmp+="  <tr>";
								tmp+=" <td class=\"head0\" width=15%>"+data[i].sku+"</td>";
								tmp+=" <td class=\"head1\" width=35%>"+data[i].goodsname+"</td>";
								tmp+=" <td class=\"head0\" width=25%>"+data[i].stock+"</td>";
								tmp+=' <td class=\"head1\" width=25%><input type="text" name="nums[]" id="nums" class="width50" value="{{$li.check_id}}" placeholder="填写数字")"  /><input type="hidden" name="id[]"  class="width50" value='+data[i].id+' /><input type="hidden" name="sku[]"  class="width50" value='+data[i].sku+' /></td>';

							}

							$("#showlist").html(tmp);
						}

					},"json");
		}

		$('#stockoutform').modal('show');
	}
</script>
<body class="withvernav">
<div class="bodywrapper">
	{{include file='/public/leftmenu.tpl'}}
	<div class="centercontent tables">
		<div class="pageheader notab">
			<h1 class="pagetitle">物料列表</h1>
			<span class="pagedesc"></span>
		</div>
		<!--pageheader-->
		<!--
		<div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
		-->
		<div id="contentwrapper" class="contentwrapper">
			<!--搜索栏-->
			<!--
			<form class="stdform stdform2" method="get" action="/overseaapi/ukstocklist">
				<div class="tableoptions">

					商品编号: <input type="text" name="other" id="other" class="width100" placeholder="请输入商品编号" value="{{$other}}" />
					库存数: <input type="text" name="stockbegin" id="stockbegin" class="width100" placeholder="请输入库存数" value="{{$stockbegin}}" />
					- <input type="text" name="stockend" id="stockend" class="width100" placeholder="请输入库存数" value="{{$stockend}}" />
					<button class="btn btn_orange btn_search radius50">Search</button>
					<!--
					&nbsp;&nbsp;&nbsp;&nbsp;  <a href="javascript:void(0)" onClick="stockout(1)" class="btn btn2 btn_help"><span>出库</span></a>
					--><!--
				</div>
			</form>
			-->
			<!--搜索栏结束-->

			<table cellpadding="0" cellspacing="0" border="0" class="stdtable">
				<thead>
				<tr>
					<th class="head0">物料编号</th>
					<th class="head1">物料数量</th>
					<th class="head1">数量</th>
					<th class="head1">单位</th>
					<th class="head0">物料名称</th>
					<th class="head1">类别</th>
					<th class="head1">单价</th>
					<th class="head1">当前仓位</th>
					<th class="head1">当前库存</th>
					<th class="head0">总数量</th>
					<th class="head1">总价</th>
				</tr>
				</thead>
				<tbody>
				{{foreach from=$materiallist item=li key=key}}
				<tr>
					<td class="head0">{{$li.materialcode}}</td>
					<td class="head1">{{$li.materialnum}}</td>
					<td class="head1">{{$li.producenum}}</td>
					<td class="head1">{{$li.dw}}</td>
					<td class="head0">{{$li.materialname}}</td>
					<td class="head1">{{$li.materialtypename}}</td>
					<td class="head0">{{$li.materwages}}</td>
					<td class="head1">{{$li.cangwei}}</td>
					<td class="head1">{{$li.num}}</td>
					<td class="head0">{{$li.totalnum}}</td>
					<td class="head1">{{$li.totalwages}}</td>
				</tr>
				{{/foreach}}
				</tbody>

			</table>
			<!--
			<div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
			-->
			<br />
			<br />
		</div>
	</div>
	<!--bodywrapper-->
</body>
</html>